<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="box" style="width:100px; height: 100px"></div>
</body>
<script>
    const oBox = document.getElementById('box');

    const test = ele => {
        const w = ele.offsetWidth;
        const h = ele.offsetHeight;
        return w * h;
    }

    const test = ele => {
        return ele.offsetWidth * ele.offsetHeight;
    }

    console.log(test(oBox));

</script>
</html>